
export function handleData(actionType, dispatch,storeName,data,sign) {
    
    let fixItems = [];
    if (data && data.data) {
        if (Array.isArray(data.data)) {
            fixItems = data.data;
        } else if (Array.isArray(data.data[sign])) {
            fixItems = data.data[sign];
        }
    }
    // 首页数据提取。
    let newObj = null;
    if(data.data.hasOwnProperty('click_apply')){
         for (let index = 0; index < fixItems.length; index++) {
            if(data.data['click_apply'].prod_id = fixItems[index].id){
                newObj = fixItems[index];
                break;
            }
         }
    }
    //第一次要加载的数据
    dispatch({
        type: actionType,
        applyData:newObj,
        projectModels:fixItems,
        storeName,
    })
}